//
//  JXStatusViewModel.swift
//  swift高仿微博
//
//  Created by peijiaxing on 16/3/2.
//  Copyright © 2016年 peijiaxing. All rights reserved.
//

import UIKit

class JXStatusViewModel: NSObject {

    var statusModel: JXStatusModel?
    
    var verifity_image: UIImage? {
        
        switch statusModel?.user?.verified_type ?? -1 {
        case -1: return nil
        case 0: return UIImage(named: "avatar_vip")
        case 2,3,5: return UIImage(named: "avatar_enterprise_vip")
        case 220: return UIImage(named: "avatar_grassroot")
        default: return nil
        }
    }
    
    // 等级
    var level_image: UIImage? {
        return UIImage(named: "common_icon_membership_level\(statusModel?.user?.mbrank ?? 0)")
    }
    
    // 转发
    var retweetString:String? {
        if statusModel?.reposts_count == 0{
            return "转发"
        }else{
            if let str = statusModel?.reposts_count{
                return "\(str)"
            }else{
                return "转发"
            }
        }
        
        }
    // 评论
    var commentString: String?
    
    
    var retweetStatusString: String?{
        return statusModel?.retweeted_status?.text
    }
    
}
